#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

class Student
{
public:
    Student(){}
    Student(int id,int age,const char * name)
    : _id(id)
    , _age(age)
    {
        strcpy(_name,name);
    }

    void print(){
        cout << "id:" << _id << endl;
        cout << "age:" << _age << endl;
        cout << "name:" << _name << endl;
    }
private:
    int _id;
    int _age;
    char _name[16];
};

void test0(){
    int a = 10;
    int b(5);
    cout << a << endl;
    cout << b << endl;

    Student s1(101,20,"Tom");
    s1.print();

    cout << endl;
    Student s2(102,21,"Jerry");
    s2.print();

    int c;
    Student s3;//无参构造函数创建对象
    Student(102,23,"Bob");//创建一个匿名对象
    /* s3.print(); */

    /* Student s4(); */
    /* s4.print(); */
}

int main(void){
    test0();
    return 0;
}
